import {lazy} from 'react'
import {Navigate} from 'react-router-dom'
import LazyLoad from './LazyLoad'
const Login=lazy(()=>import('../views/Login'))
const Home=lazy(()=>import('../views/Home'))
const SysUser=lazy(()=>import('../views/sys/user'))
const SysRole=lazy(()=>import('../views/sys/role'))
const NotFound=lazy(()=>import('../views/NotFound'))

// import Login from '../views/Login'
// import Home from '../views/Home'
// import SysUser from '../views/sys/user'
// import SysRole from '../views/sys/role'
// import NotFound from '../views/NotFound'
let routes=[
    {
        path:'/',
        element:<Navigate to={"/login"}></Navigate>
    },
    {
        path:'/login',
        element:LazyLoad(<Login></Login>)
    },
    {
        path:'/home',
        element:LazyLoad(<Home></Home>),
        children:[
            {
                path:'sys/user',
                element:LazyLoad(<SysUser></SysUser>)
            },
            {
                path:'sys/role',
                element:LazyLoad(<SysRole></SysRole>)
            }
        ]
    },
    {
        path:'*',
        element:LazyLoad(<NotFound></NotFound>)
    }
]
export default routes